package com.example.springstudy.dao.res;

import com.example.springstudy.entity.Sku;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@NoArgsConstructor
public class SkuListRes {
    private List<Sku> list;
    private int currentPage;
    private int totalPage;
    private int totalCount;

    public SkuListRes(List<Sku> list, int page, int size, int totalCount) {
        this.list = list;
        this.currentPage = page;
        this.totalPage = totalCount % size == 0 ? totalCount / size : totalCount / size + 1;
        this.totalCount = totalCount;
    }
}
